#include "tcp_connection.h"

#include <rtc_base/zmalloc.h>

namespace xrtc {
    
TcpConnection::TcpConnection(int fd) : m_fd(fd), m_querybuf(sdsempty()) {

}

TcpConnection::~TcpConnection() {
    sdsfree(m_querybuf);

    while (!m_reply_list.empty()) {
        rtc::Slice reply = m_reply_list.front();
        m_reply_list.pop_front();
        zfree((void*)reply.data());
    }

    m_reply_list.clear();
}

} // namespace xrtc

